#include <stdio.h>
#include <unistd.h>
#include <sys/wait.h>

int main()
{
    pid_t ret = fork();
    if(ret < 0 ){
        return 0;
    }else if(ret == 0){
        sleep(2);
        char* const argv[] = {"-a"};
        execvp("ls", argv);
       // execlp("ls", "ls", "-a", NULL);
    }else{
      ret = waitpid(ret, NULL, 0);
      printf("等待到了ppid：%d\n", ret);
    }
    return 0;
}
